package com.smarthouse.service;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

@Service
public class TextRecognitionService {

    private final JdbcTemplate jdbcTemplate;

    public TextRecognitionService(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public boolean verifyText(String text) {
        String sql = "SELECT COUNT(*) FROM text_record WHERE content = ?";
        int count = jdbcTemplate.queryForObject(sql, Integer.class, text);
        return count > 0;
    }
} 